using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.PlayerLoop;

public class UIList : MonoBehaviour
{
    public GameObject m_item;
    private UIListItem[] m_list_item;
    public Transform m_grip_parent;
    public Transform m_content;

    public int m_item_count = 5;

    private void Start()
    {
        
    }

    public void OnEnable()
    {
        
    }

    public void Init()
    {
        if (m_item != null)
        {
            m_list_item = new UIListItem[m_item_count];
            for (int i = 0; i < m_item_count; i++)
            {
                GameObject item = GameObject.Instantiate(m_item, m_grip_parent, true);
                item.name = i.ToString();
                UIListItem list_item = item.AddComponent<UIListItem>();
                list_item.Init();
                list_item.m_item_index = i;
                m_list_item[i] = list_item;
            }
        }
    }

    public UIListItem[] GetListItems()
    {
        return m_list_item;
    }
}
